package com.zs.ssh.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * 用户表
 *
 * @author: 赵圣
 * @date: 2018年9月25日下午8:24:40
 * @Version 1.0
 */
@Entity
@Table(name = "t_user")
public class User {
    private int id;       //用户编号00000000开始
    private String name;     //用户名
    private String password; //密码
    private int sal;         //薪资

    public User() {

    }

    public User(int id, String name, String password, int sal) {
        super();
        this.id = id;
        this.name = name;
        this.password = password;
        this.sal = sal;
    }

    @Id
//    @GeneratedValue(generator = "uid")
//    @GenericGenerator(name = "uid", strategy = "assigned")
    @Column(name = "id", nullable = false, length = 8)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Column(name = "name", nullable = false, length = 60)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "password", nullable = false, length = 60)
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Column(name = "sal", nullable = false, length = 11)
    public int getSal() {
        return sal;
    }

    public void setSal(int sal) {
        this.sal = sal;
    }

    @Override
    public String toString() {
        return "User [id=" + id + ", name=" + name + ", password=" + password
                + ", sal=" + sal + "]";
    }
}
